package com.micro.frog.fortune.config;

import com.micro.frog.fortune.sdk.cwl.CwlApi;
import com.micro.frog.fortune.sdk.cwl.impl.CwlHttp;
import com.micro.frog.fortune.sdk.cwl.model.CwlProp;
import lombok.Setter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 *
 * @author jason.lv
 * @since 2022/2/22 17:59
 */
@Configuration
@ConfigurationProperties(prefix = "api")
public class ApiConfig {

    @Setter
    private CwlProp cwl;

    @Bean
    public CwlApi cwlApi(){
        return new CwlHttp(cwl);
    }
}
